//
//  trade_rate.m
//  yuimall_Iphone
//
//  Created by yuike6 yuike6 on 12-4-14.
//  Copyright (c) 2012年 yuike. All rights reserved.
//

#import "trade_rate.h"
#import "header.h"

@implementation trade_rate
@synthesize tid;
@synthesize oid;

@synthesize role;
@synthesize nick;

@synthesize created;
@synthesize rated_nick;

@synthesize item_title;
@synthesize item_price;

@synthesize content;
@synthesize reply;

-(void) dealloc{
    
    YRelease(tid)
    YRelease(oid)
    
    YRelease(tid)
    YRelease(oid)
    
    YRelease(created)
    YRelease(rated_nick)
    
    YRelease(item_title)
    YRelease(item_price)
    
    YRelease(content)
    YRelease(reply)
    
    [super dealloc];
}

-(void) privateInit
{
    self.tid = [self.xmlTree valueAtPath:@"trade_rate/tid"];
    self.oid = [self.xmlTree valueAtPath:@"trade_rate/oid"];
    
    self.role = [self.xmlTree valueAtPath:@"trade_rate/role"];
    self.nick = [self.xmlTree valueAtPath:@"trade_rate/nick"];
    
    self.created = [NSDate string2date:[self.xmlTree valueAtPath:@"trade_rate/created"]];
    self.rated_nick = [self.xmlTree valueAtPath:@"trade_rate/rated_nick"];
    
    self.item_title = [self.xmlTree valueAtPath:@"trade_rate/item_title"];
    self.item_price = [self.xmlTree valueAtPath:@"trade_rate/item_price"];
    
    self.content = [self.xmlTree valueAtPath:@"trade_rate/content"];
    self.reply = [self.xmlTree valueAtPath:@"trade_rate/reply"];
    
}

-(id) initWithXmlTree:(XMLParsedTree *)tree
{
    self = [super initWithXmlTree:tree];
    if (self) {
        [self privateInit];
    }
    
    return self;
}


-(id) initWithXmlString:(NSString *)xmlString
{
    self = [super initWithXmlString:xmlString];
    if (self) {
        [self privateInit];
    }
    return self;
}

-(id) initWithXmlData:(NSData *)xmlData
{
    self = [super initWithXmlData:xmlData];
    if (self) {
        [self privateInit];
    }
    return self;
}
@end
